 
import { removeToken,getToken } from '@/utils/token';
const useUserStore = defineStore("user", {
  state: () => ({
    token: getToken(),
    id: "",
    name: "",
    
  }),
  actions: {
    
    // 退出系统
    logOut() {
      return new Promise((resolve, reject) => {
        this.token = "";

        removeToken();
        resolve();
      }).catch((error) => {
        reject(error);
      });
    },
  },
});

export default useUserStore
